package main

import "fmt"

/**
反转字符串
*/
func main() {
	str := "aaeresfxvxdsfsd"
	fmt.Println(fmt.Sprintf("start string is: %s", str))
	over := OverTurnStr(str)
	fmt.Println(fmt.Sprintf("overturn string is:%s", over))

}

func OverTurnStr(str string) string {
	if len(str) <= 0 {
		return ""
	}
	strArray := []byte(str)
	for i := 0; i < len(str)/2; i++ {
		tmp := str[i]
		strArray[i] = str[len(str)-i-1]
		strArray[len(str)-i-1] = tmp
	}
	return string(strArray)
}
